蟻本 2-2 Best Cow Line
code: python
n = int(input())
s = input()
# sa, aa+1, ..., sbが残っている文字列
a, b = 0, n-1
while (a <= b):
# 左から見た場合と右から見た場合を比較
left = False
i = 0
while (a + i <= b):
if (sa + i < sb - i):
left = True
break
elif (sa + i > sb - i):
left = False
break
i += 1
if (left):
print(sa, end="")
a += 1
else:
print(sb, end="")
b -= 1